package com.ln.service.impl;

import com.ln.service.BookShopService;
import com.ln.service.Carshier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/14 17:41
 */
@Service
public class CarshierImpl implements Carshier {
    @Autowired
    private BookShopService bookShopService;
    @Transactional
    public void buy(List<String> isbns, String username) {
        for (String isbn :isbns){
            bookShopService.purchase(isbn,username);
        }
    }
}
